<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>浮动-兄弟关系</title>
    <style>
        .d1{
            width: 100px;
            height: 100px;
            background-color: cadetblue;
            /* 浮动  float: left 向左边浮动 ，脱离文档流*/
            float: left;
        }

        .d2{
            width: 200px;
            height: 200px;
            background-color: orangered;
            /* 浮动  float: right 向右边浮动 ，脱离文档流*/
            float: right;
        }

        .other{
            width: 300px;
            height: 300px;
            background-color: yellowgreen;
            /* 清除上方浮动 clear: left / right / both */
            clear: both;
        }
    </style>
</head>
<body>
    <div class="d1"></div>
    <div class="d2"></div>
    <div class="other"></div>
</body>
</html>